import { Column, CreateDateColumn, Entity, Index, ManyToOne, PrimaryColumn, PrimaryGeneratedColumn } from 'typeorm';
import { ApiProperty } from '@nestjs/swagger';
import { User } from './users.entity';
import { ERestartNotif } from '../../enums/restart.enum';

@Entity()
export class UserStats {
    constructor(props?: Partial<UserStats>) {
        Object.assign(this, props);
    }

    @PrimaryGeneratedColumn('uuid')
    public id!: number;

    @ManyToOne(() => User, (user) => user.telegramId)
    public user!: User;
    @Index()
    @Column({ nullable: true })
    public userTelegramId!: string;

    @ApiProperty({ example: '', description: 'description action' })
    @Column({
        nullable: true,
        type: 'numeric',
    })
    public calories!: number;

    @ApiProperty({ example: '', description: 'description action' })
    @Column({
        nullable: true,
        type: 'numeric',
    })
    public protein!: number;

    @ApiProperty({ example: '', description: 'description action' })
    @Column({
        nullable: true,
        type: 'numeric',
    })
    public totalFat!: number;

    @ApiProperty({ example: '', description: 'description action' })
    @Column({
        nullable: true,
        type: 'numeric',
    })
    public carbohydrate!: number;

    @ApiProperty({ example: '21.23.1990', description: 'date notification' })
    @Column({
        nullable: true,
        type: 'timestamptz',
    })
    public date!: Date;
}
